<link href="../addons/jy_weishoplive/resource/room.css?v=51" rel="stylesheet">
<div ng-if="pagedata.item.isscreen==1">
<style>
.fullscreen .block-video .video {
        height: 100%;
        width: 100%;
        object-fit: cover;
}
.floatright-icon .icon-one i{color:#fff}
.floatright-icon {bottom:0}
.block-video2 {height:100%}
.tofullscreen {top:3.5rem}
.video-js {background:none}
.video-js .vjs-tech {
    position: absolute;
    object-fit: cover;
}
</style>
</div>
<div ng-if="pagedata.item.isscreen!=1">
<style>
.block-video {position:absolute;width:100%}
.block-video .video {
        height: 210px;
        width: 100%;
}
.video-js {background:none}
.player-dimensions.vjs-fluid {padding-top:0}
</style>
</div>
<header class="app-header">
	<div ng-class="{'block-info':1,'tofullscreen':pagedata.tofullscreen}">
                <div class="live-info">
                    <div class="face">
                        <img ng-src="{{tomedia(pagedata.item.image) || '../core/resource/images/nopic.jpg'}}" />
                    </div>
                    <div class="text">{{pagedata.item.title}}</div>
                </div>
				<div ng-if="pagedata.isboss==1 && pagedata.pluginset.nosendcoupon!=1" ng-click="pagedata.sendcoupon();" class="jylabel jylabel-info-0 active" style="margin-top:0.1rem;margin-left:0.5rem;height:1.3rem;line-height:0.95rem">发券</div>
				<div ng-if="pagedata.isboss==1 && pagedata.pluginset.nosendred!=1" ng-click="pagedata.showhongbao()" class="jylabel jylabel-red-0 active" style="margin-top:0.1rem;margin-left:0.2rem;height:1.3rem;line-height:0.95rem">发红包</div>
     </div>
     <div ng-class="{'block-online':1,'tofullscreen':pagedata.tofullscreen}">
                <div class="online"><span id="online">{{pagedata.item.looks || 0}}</span>人观看</div>
     </div>
	<!-- 关注按钮 -->
	<!--弹目-->
	<div class="video-sms-list">
		<!--<li class="video-sms-pane">
			 <div class="video-sms-text">
				<img class="video-sms-logo" ng-src="{{tomedia() || '../core/resource/images/nopic.jpg'}}"/>
				<span class="overflow-h">：不错我！</span>
			</div>
        </li>-->
	</div>
	<div class="likepiaofu"></div>
	<div class="followpiaofu"></div>
	<div ng-if="pagedata.item.isscreen==1 && pagedata.goodslist[0].title" href="javascript:" ng-click="pagedata.showgoods=true" class="left-living fui-list-group merchgroup" style="position: fixed;width:10rem;bottom:4rem;height:auto;padding:0.2rem;z-index:888">
            <div class="fui-list jump " style="padding:0.2rem">
                <a class="fui-list-media">
                    <img class="round" ng-src="{{tomedia(pagedata.goodslist[0].image) ||'../core/resource/images/nopic.jpg'}}">
                </a>
                <a class="fui-list-inner" style="color:#fff">
                    <div class="title" style="color:#fff">{{pagedata.goodslist[0].title}}</div>
                    <div class="price">￥<span class="red">{{pagedata.goodslist[0].price}}</span></div>
                </a>
                <a class="fui-remark jump">
                </a>
            </div>   
	</div>
	<div class="floatright-icon">
	<div class="" href="javascript:;" ng-click="pagedata.setfollow();toogle(pagedata.item,'islike',[1,0]);" style="margin-bottom:1rem;right:8px">
		<div class="avatar-follow"><img class="img-circle" ng-src="{{tomedia(pagedata.item.image) || '../core/resource/images/gw-user.png'}}" style="width:46px;height:46px" /></div>
			<i ng-class="{'icon':1,'icon-follow':pagedata.item.islike !=1,'icon-xiai':pagedata.item.islike ==1}" style="color:red;position: absolute;top:33px;right:16px"></i>
	</div>
	<div ng-if="pagedata.item.showlooks" class="video-keep-pane" style="position:relative;right:-0.7rem;bottom:0;">
		<div class="video-keep-text">
			<img ng-repeat="img in pagedata.lookusers" class="video-keep-logo" style="margin-left:-1rem" ng-src="{{tomedia(img.avatar) || '../core/resource/images/nopic.jpg'}}"/>
			<span class="overflow-h">{{pagedata.item.looks || 0}}人</span>
		</div>
	</div>
	<div ng-if="pagedata.item.isscreen==1" class="icon-one">
		<a ng-click="pagedata.showroominfo=true">
			<i class="icon icon-gonggao"></i>
		</a>
		<div class="bai" style="font-size:0.5rem;">公告</div>
	</div>
	<div ng-if="pagedata.pluginset.nosendred!=1" class="icon-one">
		<a ng-click="pagedata.showhongbao()">
			<i class="icon icon-ai-hongbao" style="font-size:1.5rem;color:red"></i>
		</a>
		<div ng-class="{'bai':pagedata.item.isscreen==1}" style="font-size:0.5rem;">发红包</div>
	</div>
	<div ng-if="pagedata.pluginset.nosendliping!=1" class="icon-one">
		<a onclick="$('#sendliping').modal();">
			<i class="icon icon-shengriliwu" style="font-size:1.7rem;color:red;margin-left:-0.1rem"></i>
		</a>
		<div ng-class="{'title':1,'bai':pagedata.item.isscreen==1}" style="font-size:0.5rem;">送礼</div>
	</div>
	<div class="icon-one">
		<a ng-click="pagedata.vote();pagedata.item.isvote=1">
			<i ng-class="{'icon':1, 'icon-good':pagedata.item.isvote!=1,'icon-good-filling':pagedata.item.isvote==1}"></i>
		</a>
		<div ng-class="{'bai':pagedata.item.isscreen==1}" style="font-size:0.5rem;">{{pagedata.item.isvote==1?'已赞':'赞'}}:{{pagedata.item.votes || 0}}</div>
	</div>
	
	<div class="icon-one">
		<a ng-click="pagedata.setshoucang();toogle(pagedata.item,'islike',[1,0])">
			<i ng-class="{'icon':1, 'icon-follow':pagedata.item.islike!=1,'icon-xiai':pagedata.item.islike==1}"></i>
		</a>
		<div ng-class="{'bai':pagedata.item.isscreen==1}" style="font-size:0.5rem;" ng-if="pagedata.item.islike !=1">收藏</div>
		<div ng-class="{'bai':pagedata.item.isscreen==1}" style="font-size:0.5rem;" ng-if="pagedata.item.islike ==1">已收藏</div>
	</div>
	<div class="icon-one">
		<a onclick="$('#showsharecover').modal();">
			<i class="icon icon-fenxiang2"></i>
		</a>
		<div ng-class="{'bai':pagedata.item.isscreen==1}" style="font-size:0.5rem;">转发</div>
	</div>
	</div>
	<div ng-if="pagedata.item.isscreen==1" class="footer-msg" style="width:calc(100% - 50px);z-index:888">
        <div class="fui-cell-group" style="background:none;margin-top:0">
			<div class="fui-cell noborder">
				<div class="fui-cell-text" style="color:#fff;font-size:0.5rem"><img src="../addons/jy_weishoplive/resource/img/auido-bai.gif" style="margin-top:-2px;width:10px;height:10px" /> {{pagedata.item.title}}</div>
			</div>
			<div class="fui-cell noborder" ng-click="pagedata.change()" style="padding-top:0">
				<input style="border-width:0;font-size:0.65rem;background:#666;border-radius:1.2rem;padding:0.3rem 0.5rem;opacity:0.5;color:#fff;" id="input" type="text" ng-model="pagedata.post.msg" placeholder="跟大家说点什么吧..." />
				<div ng-click="pagedata.setmsg(pagedata.post.msg)" ng-class="{'btn-send':1,'active':pagedata.post.msg}">发送</div>
			</div>
		</div>
    </div>
</header>
<div class="fui-page">
    <div ng-class="{'fui-content':1, 'fullscreen':pagedata.item.isscreen==1}">
        <div ng-if="!pagedata.wsConfig.isIos && pagedata.ispay" class="block-title">{{pagedata.item.title}}</div>
        <div class="prompt">
            <div class="live-tips loading">
                <div class="inner">
                    <div class="text">加载直播间配置中</div>
                    <div class="date"></div>
                </div>
            </div>
            <div class="live-tips play btn-play">
                <div class="inner">
                    <div class="text"><i class="icon icon-iconfontplay2"></i></div>
                </div>
            </div>
            <div class="live-tips stop">
                <div class="inner">
                    <div class="text">直播还未开始</div>
                    <div class="date">预计{{pagedata.item.livetime2}}开播</div>
                </div>
            </div>			
            <div class="live-tips pause">
                <div class="inner">
                    <div class="text">管理员暂停了直播</div>
                    <div class="date">请稍等片刻</div>
                </div>
            </div>
        </div>
		<div class="block-video2 bg-blur" style="background-image: url('{{tomedia(pagedata.item.image)}}');">
        </div>
        <div class="block-video" id="my-videoblock">
            <video ng-if="pagedata.item.isscreen!=1" id="player" class="video-js vjs-default-skin vjs-big-play-centered video" src="{{tomedia(pagedata.item.video)}}" x-webkit-airplay="allow" preload="auto" webkit-playsinline x5-playsinline playsinline>
                <source src="{{tomedia(pagedata.item.video)}}"  type="application/x-mpegURL">
                <source src="{{tomedia(pagedata.item.video)}}"  type="application/x-mpegURL">
            </video>
			<video ng-if="pagedata.item.isscreen==1" id="player" class="video-js vjs-default-skin vjs-big-play-centered video" src="{{tomedia(pagedata.item.video)}}" x-webkit-airplay="allow" poster="" preload="auto" webkit-playsinline playsinline x5-video-player-type="h5" x5-video-player-fullscreen="true">
                <source src="{{tomedia(pagedata.item.video)}}"  type="application/x-mpegURL">
                <source src="{{tomedia(pagedata.item.video)}}"  type="application/x-mpegURL">
            </video>
        </div>

        <div ng-if="pagedata.item.isscreen!=1" class="block-tab" style="top:210px">
            <a ng-repeat="row in pagedata.item.nestable" ng-click="pagedata.tabname=row" ng-if="pagedata.item.menu[row].noshow!=1" ng-class="{'active':pagedata.tabname==row}">
							<div ng-if="!pagedata.item.menu[row].name">
							 <div ng-if="row=='interaction'">直播间</div>
							 <div ng-if="row=='goods'">商品</div>
							 <div ng-if="row!='interaction' && row!='goods'">介绍</div>
							</div>
                            <div ng-if="pagedata.item.menu[row].name">
                            {{pagedata.item.menu[row].name}}
							</div>
            </a>
        </div>
        <div ng-class="{'block-content':1,'nobgcolor':pagedata.item.isscreen==1}" style="z-index: 11">
            <div class="layer-enter">
                <div class="name">...</div>
                <div class="text">进入直播间</div>
            </div>
            <div class="layer-at layer">
                <div class="layer-close"></div>
                <div class="at-text">管理员@了你</div>
                <div class="at-icon">@</div>
            </div>
            <div class="tab-content" id="ismsg" style="overflow-y:scroll;height:13rem" ng-if="pagedata.tabname=='interaction'">                  
					<a ng-repeat="record in pagedata.records" ng-if="record.type=='goods'" ng-class="{'msg':1, 'nopadding':pagedata.item.isscreen==1}">
                        <div class="content">
                            <div class="goods">
                                <div class="thumb"><img ng-src="tomedia(record.goodsthumb)"></div>
                                <div class="info">
                                    <div class="title">{{record.goodstitle}}</div>
                                    <div class="price">
                                        <div class="num">￥{{record.goodsprice}}</div>
                                        <div class="btn-buy">购买</div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </a>
                    <div ng-repeat="record in pagedata.msgs" ng-if="record.type!='goods'" ng-class="{'msg':1, 'nopadding':pagedata.item.isscreen==1 && (record.status || record.type=='redpack' || record.type =='coupon' || record.type=='goods')}">
                        <div ng-if="record.tip" class="tip">
                            <div class="text">{{record.tip}}</div>
                        </div>
                        <div ng-class="{'nickname':1, 'self':record.uid==pagedata.member.id}">{{record.username}}{{record.uid==pagedata.member.id?'(你)':''}}:&nbsp;</div>
                        <div class="content">
                            <span ng-class="{'bai':pagedata.item.isscreen==1}">{{record.content}}</span>
                            <span ng-if="record.uid==pagedata.memebr.id" ng-click="pagedata.delmsg($index);pagedata.msgs.splice($index,1)" class="btn-repeal">撤销</span>
                        </div>
                    </div>
					<div class="content-empty" ng-if="(!pagedata.msgs || pagedata.msgs.length == 0) && pagedata.item.isscreen!=1">
						  <i class="icon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">暂时没聊天信息！</p>
					</div>
            </div>
				<div ng-if="pagedata.item.isscreen!=1">
                <div ng-if="pagedata.tabname=='goods'" class="tab-content">
                    <a class="goods-item" ng-repeat="item in pagedata.goodslist">
                        <div class="thumb">
                            <img ng-src="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}" alt="{$row['title']}" />
                        </div>
                        <div class="info">
                            <div class="title">{{item.title}}</div>
                            <div class="price">
                                <div class="num">
                                    <span class="label">直播价</span>
                                    <span class="bigprice">&yen;{{item.optionid>0?item.price:item.liveprice}}</span>
                                    <span class="product">&yen;{{item.optionid>0?item.oldprice:item.price}}</span>
									<div ng-click="pagedata.showspec(item)" class="btn-buy" style="margin-left:1rem">立即购买</div>
                                </div>
                            </div>
                        </div>
                    </a>
					<div class="content-empty" ng-show="!pagedata.goodslist || pagedata.goodslist.length == 0 ">
						  <i class="icon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">暂时没商品展示！</p>
					</div>
                </div>
                <div ng-if="pagedata.tabname=='introduce'" class="tab-content">
                    <div class="shop-info">
                        <div class="logo">
                            <img ng-src="{{tomedia(pagedata.shopset.logo) || '../core/resource/images/nopic.jpg'}}" />
                        </div>
                        <div class="info">{{pagedata.shopset.title}} <a class="btn-enter" ng-click="access_json('jy_weishop/index/')" style="">进入商城</a></div>
                    </div>
                    <div class="room-info">
                        <p>直播间: {{pagedata.item.title}}</p>
                        <p>直播时间: {{pagedata.item.livetime2}}</p>
                    </div>
                    <div class="room-info">
                        <p>直播间介绍: {{pagedata.item.content || '暂无介绍'}}</p>
                    </div>
                </div>
                <div ng-if="pagedata.tabname=='customname1'" class="tab-content" data-tab="customname1" style="background: #fff;padding:0.5rem;">{{pagedata.item.content || '暂无介绍'}}</div>
                <div ng-if="pagedata.tabname=='customname2'" class="tab-content" data-tab="customname2" style="background: #fff;padding:0.5rem;">{{pagedata.item.content || '暂无介绍'}}</div>
                <div ng-if="pagedata.tabname=='customname3'" class="tab-content" data-tab="customname3" style="background: #fff;padding:0.5rem;">{{pagedata.item.content || '暂无介绍'}}</div>
                <div ng-if="pagedata.tabname=='customname4'" class="tab-content" data-tab="customname4" style="background: #fff;padding:0.5rem;">{{pagedata.item.content || '暂无介绍'}}</div>
            </div>
        </div>
        <div ng-if="pagedata.item.notice" class="block-notice">
            <a class="inner" ng-click="access_json(pagedata.item.notice_url)" data-nocache="true">直播间公告：{{pagedata.item.notice}}</a>
        </div>
        <!--<div class="block-icon">
            <div ng-if="pagedata.item.isscreen==1" class="btn-content btn-hide" ></div>
            <div ng-if="pagedata.item.isscreen==1" class="btn-content btn-show"></div>
            <div ng-if="pagedata.room_coupon && pagedata.item.iscoupon>0" class="btn-gift btn-gifts" ></div>
            <div class="btn-like live-info"></div>
            <a ng-if="pagedata.item.invitation_id" ng-click="access_json('jy_invitation/index/detail/type=live&id='+pagedata.item.invitation_id+'&roomid='+pagedata.item.id)" class="btn-share external"></a>
        </div>-->
        <div class="layer-mask"></div>
        <!-- 店铺信息+关注弹窗 -->
        <div ng-if="pagedata.showroominfo" class="popup">
            <div class="popup-body">
				<div class="popup-center" style="width:80%">
						<i class="closed icon icon-cuowu" ng-click="pagedata.showroominfo=false"></i>
						<div class="room-face">
							<img ng-src="{{tomedia(pagedata.item.image) || '../core/resource/images/gw-user.jpg'}}" />
						</div>
						<div class="room-title">{{pagedata.item.title}}</div>
						<div class="room-info">
							<p>直播间：{{pagedata.item.title}}</p>
							<p>直播时间：{{pagedata.item.livetime2}}</p>
						</div>
						<div class="room-info">直播间介绍：{{pagedata.item.content}}</div>
						<div class="room-qrcode">
							<img ng-src="{{tomedia(pagedata.account.ewm) || '../core/resource/images/nopic.jpg'}}" />
						</div>
					</div>
			</div>
		</div>

        <!-- 礼物弹窗 -->
        <div ng-if="pagedata.showcoupon" class="popup">
            <div class="popup-body">
				<div class="popup-center" style="width:90%">
						<i class="closed icon icon-cuowu" ng-click="pagedata.showcoupon=false"></i>
						<div class="inner">
							<div ng-include="sys_html('coupon/common/_couponlist','','','jy_weishop')"></div>
						</div>
					</div>
			</div>
        </div>

        <!-- 红包弹窗 -->
        <div ng-if="pagedata.showredpack" class="popup">
            <div class="popup-body">
				<div class="popup-center layer-redpack" style="width:15rem;height:18rem">
					<i class="closed icon icon-cuowu" ng-click="pagedata.showredpack=false"></i>
					<div class="redpack-title">红包来了，速抢速抢速抢速抢速抢</div>
					<!-- 抢之前显示 -->
					<div class="redpack-bg"></div>
					<div ng-click="pagedata.chouhb(pagedata.redid);" class="redpack-draw">抢</div>
					<!-- 抢之后显示 -->
					<div ng-if="pagedata.isgetred" class="redpack-info">
						<div class="price"><span>￥</span>{{pagedata.redmoney}}</div>
						<div class="type">{{pagedata.moneytext}}红包</div>
					</div>
					<div ng-if="pagedata.isgetred" class="redpack-list">
						<div class="title">领取记录：</div>
						<div class="inner">
							<div ng-repeat="item in pagedata.redlist" class="item">
								<div class="avatar">
									<img ng-src="{{tomedia(item.avatar) ||'../core/resource/images/gw-user.jpg'}}">
								</div>
								<div class="nickname">{{item.nickname}}</div>
								<div class="price"><span>￥</span>{{item.fee}}</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>

        <!-- 优惠券弹层 -->
        <div ng-if="pagedata.showgetcoupon" class="popup">
            <div class="popup-body">
				<div class="popup-center layer-coupon" style="padding-top:0;padding-bottom:1rem">
				<i class="closed icon icon-cuowu" ng-click="pagedata.showgetcoupon=false"></i>
				<div ng-if="pagedata.coupon_nolast" class="coupon-title">很遗憾，没抢到</div>
				<div ng-if="pagedata.coupon_isout" class="coupon-title">优惠券飞走了</div>
				<div class="coupon-inner">
					<div class="coupon-bg">
						<div class="coupon-block">
							<div class="coupon-gold"></div>
							<div class="coupon-gift"></div>
							<div class="price"><span class="money">{{pagedata.nowcoupon.title3}}</span></div>
							<div class="desc">{{pagedata.nowcoupon.title}}</div>
						</div>
					</div>
				</div>
				<div class="coupon-btn">
					<a class="btn btn-blue" ng-click="access_json('jy_weishop/coupon.index/')" data-nocache="true">去查看</a>
					<a ng-if="!pagedata.coupon_nolast && !pagedata.coupon_isout" class="btn btn-goon" ng-click="pagedata.getcoupon()">继续领取</a>
					<div ng-if="pagedata.coupon_jsget" class="btn btn-yellow">去使用</div>
				</div>
				<div class="coupon-fail"></div>
			</div>
			</div>
		</div>
        <!--商品弹层 -->
        <div ng-if="pagedata.showgoods" class="popup">
            <div class="popup-body">
			<div class="popup-center">
				<i class="closed icon icon-cuowu" ng-click="pagedata.showgoods=false"></i>
				<div class="inner">
					<a ng-repeat="item in pagedata.goodslist" class="goods-item">
						<div class="thumb">
							<img ng-src="{{tomedia(item.image) || '../core/resource/images/nopic.jpg'}}" />
						</div>
						<div class="info">
							<div class="title">{{item.title}}</div>
							<div class="price">
								<div class="num">
									<span class="label">直播价</span>
									<span class="bigprice">&yen;{{item.optionid>0?item.price:item.liveprice}}</span>
                                    <span class="product">&yen;{{item.optionid>0?item.oldprice:item.price}}</span>
								</div>
								<div ng-click="pagedata.showspec(item)" class="btn-buy">立即购买</div>
							</div>
						</div>
					</a>
				</div>
			</div>
			</div>
		</div>
        <div ng-if="pagedata.item.isscreen!=1" class="fui-footer block-input">
            <div ng-if="pagedata.goods.id" class="btn-goods"></div>
            <div class="input" ng-click="pagedata.change()">
                <input id="input" type="text" ng-model="pagedata.post.msg" placeholder="跟大家说点什么吧..." />
                <!--<div class="btn-emoji"></div>-->
            </div>
            <!--<div ng-if="pagedata.item.isscreen!=1" class="btn-plus"></div>-->
            <div ng-click="pagedata.setmsg(pagedata.post.msg)" ng-class="{'btn-send':1,'active':pagedata.showbtnsend && pagedata.post.msg}">发送</div>
        </div>
        <div ng-if="pagedata.item.isscreen!=1 && pagedata.showgoto" class="block-plus">
            <div class="inner">
                <a class="item btn-refresh">
                    <div class="item-icon">
                        <i class="icon icon-refresh"></i>
                    </div>
                    <div class="item-text">刷新</div>
                </a>
                <a class="item external" ng-click="access_json('jy_weishop/index/')">
                    <div class="item-icon">
                        <i class="icon icon-home"></i>
                    </div>
                    <div class="item-text">商城</div>
                </a>
                <a class="item external" ng-click="access_json('jy_weishop/member.index/')">
                    <div class="item-icon">
                        <i class="icon icon-wo1"></i>
                    </div>
                    <div class="item-text">会员中心</div>
                </a>
                <a ng-if="pagedata.item.invitation_id" class="item external" ng-click="access_json('jy_invitation/index/detail/type=live&id='+pagedata.item.invitation_id+'&roomid='+pagedata.item.id)">
                    <div class="item-icon">
                        <i class="icon icon-dingdan"></i>
                    </div>
                    <div class="item-text">邀请卡</div>
                </a>
            </div>
        </div>
        <div ng-if="pagedata.showemoji" class="block-emoji">
             <div ng-repeat="item in pagedata.emojiList" class="item" title="{{item}}"></div>
        </div>
    </div>
</div>
<div id="sendliping"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0%;bottom:0">
<div class="modal-content" >
    <!--送礼物-->
		<div class='fui-cell-title text-center' style="background: white;">选择礼品</div>
		<div class="fui-icon-group noborder col-4" style="background: #ffffff;padding-left:15px;padding-right:15px;padding-bottom:15px">
			<a ng-repeat="lp in pagedata.liping"  class="fui-icon-col external" href="javascript:;" ng-click="pagedata.sendlp(lp.id);">
					<div class="fui-cell-icon"><img class="img-circle" ng-src="{{tomedia(lp.picurl) || '../core/resource/images/gw-user.png'}}" style="width:38px;height:38px" /></div>
					<div class="text" style="color: #666666;">{{lp.title}}</div>
					<div class="subtitle" style="color: #666666;font-size:0.5rem">价格:{{lp.price}}</div>
					<div class="subtitle" style="color: #666666;font-size:0.5rem">{{pagedata.group.type==0?'票数':'赞数'}}:{{lp.jifen}}</div>
			</a>
			<div class="content-empty" ng-show="!pagedata.liping || pagedata.liping.length == 0 " style="margin-top:1rem">
						  <i class="icon icon-cry" style="width: 6rem;margin-bottom: 0.5rem;"></i><br/><p style="color: #999;font-size: .75rem">暂时没礼品！</p>
			</div>
		</div>
		
</div>
</div>
</div>
<div id="showhongbao"  class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0%;top:2%">
<div class="jymodal-content" style="background:url('{{tomedia(pagedata.pluginset.o_hongbao) || '../addons/jy_weishoplive/resource/img/h-480.png'}}') no-repeat;background-size:100% 100%;padding:30px">
		<div aria-hidden="true" data-dismiss="modal" class="closebtn" style="top:50px;right:30px"><i class="icon icon-wrong" style="font-size:0.9rem;font-weight:bold"></i></div>
		<div class="fui-cell-group" style="padding:150px 15px 30px 15px;background:none;">	
				<div class="fui-cell noborder">
						<div id="oninput" class="fui-cell-info" style="align-items: center;display: flex; -webkit-box-align: center;background:#fff;border-radius:1.2rem;padding:0.1rem 0.5rem">红包金额：<input type="text" class='fui-input' onblur="reset_body()" onkeyup='clearNoNum(this)' placeholder="请输入红包金额" ng-model="pagedata.post.money" style="white-space:nowrap;width:6rem;font-size:0.7rem;height:1.4rem"/></div>
				</div>
				<div class="fui-cell noborder" style="margin-top:0;padding-top:0">
					<div class="fui-cell-text name ">
						<span ng-repeat="item in pagedata.pluginset.red_fees" class="fui-tag fui-tag-red-o" style="color:red" ng-click="pagedata.post.money=item.fee">{{item.fee}}元红包</span>
						<div class="coupon-mini" style="color:#fff;padding:0.2rem">快速选择一个红包发送 <i class="icon icon-yuding" style="font-size:0.5rem;color:#fff"></i></div>
					</div>
				</div>
				<div class="fui-cell must noborder" style="padding-top:0;">
						<div class="fui-cell-info" style="align-items: center;display: flex; -webkit-box-align: center;white-space:nowrap;background:#fff;border-radius:1.2rem;padding:0.1rem 0.5rem">赠送人：<input type="text" class='fui-input' onblur="reset_body()" placeholder="请输入您的姓名"  ng-model="pagedata.post.username" style="white-space:nowrap;width:6rem;font-size:0.7rem;height:1.4rem" /></div>
				</div>
				<div class="fui-cell noborder" style="padding-top:0">
					<div class="fui-cell-info" style="color:#fff"><i class="icon icon-biaoqing" style="color:#fff"></i> 红包金额全部转至发布人账号~</div>
				</div>
				<a ng-click="pagedata.sendhb();" class="btn btn-success block bold" style="background:#FF9900;color:#CC3300;border-radius:1.2rem;height: 2.3rem;line-height: 2.1rem;padding: 0 0.6rem;font-size:1rem">塞钱进红包</a>
		</div>
</div>
</div>
</div>
<!--投票弹红包-->
<div ng-if="pagedata.chaihb" class="popup">
     <div class="popup-body">
		<div class="popup-center layer-redpack" style="padding:0;width:15rem;height:18rem">
					<i class="closed icon icon-cuowu" ng-click="pagedata.chaihb=false"></i>
					<div class="chaihb" id="chaihb">
						<div class="hongbao">
							<div class="topcontent">
								<div class="avatar">
									<img ng-src="{{tomedia(pagedata.item.image) || '../core/resource/images/gw-user.jpg'}}" alt="" width="80" height="80">
								</div>
								<div class="moneyfont" style="margin-top:0.1rem;color:#fff;font-size:1rem">{{pagedata.item.nickname || '主播'}}</div>
								<span class="text">给你发了一个红包</span>
								<div class="description" style="color:#fff">恭喜发财 大吉大利</div>
							</div>
							<div class="chai" id="chai">
								<span ng-click="pagedata.chouhb();" aria-hidden="true" data-dismiss="modal" class="fontchai">拆红包</span>
							</div>
						</div>
					</div>
		</div>
	</div>
</div>

<!-- 红包页面 -->
<div ng-if="pagedata.loadingToast" class="popup">
     <div class="popup-body">
		<div class="popup-center layer-redpack" style="padding:0;width:15rem;height:18rem">
					<i class="closed icon icon-cuowu" ng-click="pagedata.loadingToast=false"></i>
					<div class="arterweima" style="border-radius: 0.5rem;">
						<div class="money c" style="width:100%;border-radius: 0.5rem;">
							<div class="moneytop" style="border-top-left-radius: 0.5rem;border-top-right-radius: 0.5rem;"></div>
							<div class="moneyimg">
								<img src="{{tomedia(pagedata.item.image)}}"/>
							</div>
							<div class="moneyfont">
								<p>{{pagedata.item.title}}的红包</p>
								<p style="color:#cfcac7">{{pagedata.item.hb_msg||'恭喜发财，大吉大利！'}}</p>
							</div>
							<div class="moneynum">
							<p><font class="moneysize">{{pagedata.redmoney || 0}}</font><font style="font-size:12px;">元</font></p>
							</div>
							<p style="font-size:12px;">{{pagedata.pluginset.ismoneyred ? '已通过公众号发送，请查收' : '已发送到个人中心的余额红包，请查收'}}</p>
						</div>
					</div>
		</div>
	</div>
</div>
<!--分享弹层-->
<div id="showsharecover" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:100%;left:0;top:0">
	<div id="cover">
		<div class='fui-mask-m visible'></div>
		<div class='arrow'></div>
		<div class='content'>请点击右上角<br/>通过【发送给朋友】<br/>邀请好友点赞哦！</div>
	</div>
</div>
</div>
<div id="showspec" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
	<div class="modal-dialog" style="width:100%;left:0;bottom:0">
	<div class="modal-content" ng-include="sys_html('shop/picker')"></div>
	</div>
</div>
<!-- 直播二维码页面 -->
<div ng-if="pagedata.item.type==3" class="popup">
     <div class="popup-body">
		<div class="popup-center" style="padding:1rem;width:80%">
				<div class="fui-icon-group noborder col-5">
					 <div class="fui-list">
						<div class="fui-card" style="margin-left:auto;margin-right:auto;padding-top:0;border-radius:0.5rem">
							<img style="width:8rem;height:8rem;border-radius:0.5rem" src="{{tomedia(pagedata.item.roomewm) || '../core/resource/images/nopic.jpg'}}"  />
						</div>
					</div>
					<div  class="fui-line-title">
						<div class="text text-danger bold" style="margin-bottom: -8px;">———— *  <span>长按上面直播间二维码</span> * ————</div>
					</div>
				</div>
		</div>
	</div>
</div>
<script src="../addons/jy_weishoplive/resource/live.js"></script>
<script>
scope.pagedata.showhongbao=function(){
	$('body').addClass('fixed');
	$('#showhongbao').modal();
}
$('#ismsg').animate({scrollTop:100000},300);
scope.pagedata.tabindex=0;
scope.pagedata.roomedit=true;
scope.pagedata.settab=function (index) {
	scope.pagedata.tabindex=index;
	if(scope.pagedata.tabindex==2){
		scope.pagedata.desc()
	}
	if(scope.pagedata.tabindex==3){
		scope.pagedata.customname1()
	}
	if(scope.pagedata.tabindex==4){
		scope.pagedata.customname2()
	}
}
scope.pagedata.change=function () {
	scope.pagedata.showbtnsend=true;
}
scope.pagedata.showspec=function (item) {
	$('#showspec').modal();
	scope.pagedata.goods=item
	scope.pagedata.post.goodsid=item.id
	scope.pagedata.post.optionsid=item.options.id
	scope.pagedata.post.specid=item.selectspecs
	scope.pagedata.options=item.options
	scope.$evalAsync();
}
//概率计算
scope.pagedata.random=function(rate){
	var rate = parseInt(rate);
	var n = Math.random() * 100;
	if(n <= rate){
		return true
	}else{
		return false
	}
}
if(scope.pagedata.item.video){	
	setTimeout(function(){ live(1); }, 100);
	$('.stop').hide();
}else{
	$('.loading').hide();
	$('.stop').show();
}
scope.pagedata.getitem=function(type){
	if(type==1){
		var roomid=scope.pagedata.onid
	}else{
		var roomid=scope.pagedata.nextid
	}
	scope.page_loading();
	scope.get('jy_weishoplive/room//id='+roomid,function(res){
		scope.pagedata=$.extend(scope.pagedata,res)
		scope.page_loading('hide');
		if(scope.pagedata.item.video){
			live(1);
		}
		scope.$evalAsync();
	});
}
//发红包
scope.pagedata.sendhb=function(){
	var params={
		data:{'money':scope.pagedata.post.money,'username':scope.pagedata.post.username},
		op:'jy_weishoplive/room/sendhb/',
		callback:function(res){
			if(res.payid){
				require(['tool'],function(tool){
					tool.pay(res.payid,function(res){
						if(res.type=='success'){
							$('#showhongbao').modal('hide');
							scope.message('支付成功！');
							
						}else{
							scope.message('支付失败！失败原因：'+res.message,'error');
						}
					});
				});
			}
		}
	};
	scope.post_json(params);

}
scope.pagedata.chouhb=function(redid){
	redid=redid?redid:'';
	var params={
		data:{},
		op:'jy_weishoplive/room/chouhb/redid='+redid,
		callback:function(res){
			if(res.ok){
				scope.pagedata.redmoney = res.fee;
				setTimeout(scope.pagedata.loadingToast=true,500);
				if(redid){
						scope.pagedata.isgetred=true
						scope.pagedata.redlist=res.redlist
				}
				scope.pagedata.chaihb=false
				scope.$evalAsync();
			}else{
				scope.message(res.msg)
			}
		}
	};	
	scope.post_json(params);
}
//提交礼物
scope.pagedata.sendlp=function(lpid){
	var params={
		data:{'lpid':lpid},
		op:'jy_weishoplive/room/sendlp/',
		callback:function(res){
			//scope.message(res.msg)
				if(res.payid){
				require(['tool'],function(tool){
					tool.pay(res.payid,function(res){
						if(res.type=='success'){
							$('#sendliping').modal('hide');
							scope.message('支付成功！');
							
						}else{
							scope.message('支付失败！失败原因：'+res.message,'error');
						}
					});
				});
			}
			
		}
	};
	scope.post_json(params);
}

require(['swiper'], function (Swiper) {
	console.log('swiper')
    var swiper = new Swiper('.swiper-container', {
      direction: 'vertical',
      pagination: {
        el: '.swiper-pagination',
        //clickable: true,
      },
	  on:{
        touchEnd:function(event){
			console.log(swiper.translate)
			var _contentHeight = document.getElementsByClassName('swiper-container')[0].offsetHeight;
			var allheight = _contentHeight
			scope.pagedata.contentHeight=_contentHeight;
			scope.$evalAsync();
			console.log('allheight');console.log(allheight)
			if((swiper.translate<= -allheight- 50 && swiper.translate < 0) && (scope.pagedata.next || scope.pagedata.item.video)){
				 if(!scope.pagedata.nextmsg && !scope.pagedata.item.video){
					scope.pagedata.nextmsg=true
					scope.pagedata.getitem();
					//scope.message('最后一张图了,再次上滑阅读下一商品！');
				 }else{
					if(scope.pagedata.nextid){
						//window.location.href=scope.pagedata.nexturl
						scope.pagedata.getitem();
					}else{
						scope.message('已经是最后一个直播间了！');
					}
					//scope.access_json('jy_weishopvideo/o_detail//id='+scope.pagedata.nextid)
				 }
			}
			if((swiper.translate>= 60)){
				 if(!scope.pagedata.onmsg && !scope.pagedata.item.video){
					scope.pagedata.onmsg=true
					scope.pagedata.getitem(1);
					//scope.message('已经是第一张图了,再次下滑阅读上一商品！');
				 }else{
					if(scope.pagedata.onid){
						//window.location.href=scope.pagedata.onurl
						scope.pagedata.getitem(1);
					}else{
						scope.message('已经是第一个直播间了！');
					}
					//scope.access_json('jy_weishopvideo/o_detail//id='+scope.pagedata.onid)
				 }
			}
        },        
        slidePrevTransitionEnd:function(){
			console.log('prev')
            scope.pagedata.next=false
			scope.pagedata.nextmsg=false
        },
        slideNextTransitionEnd:function(){
			scope.pagedata.index = swiper.activeIndex;
			scope.pagedata.next=true;
			scope.pagedata.onmsg=false
			console.log('next');
        },
	}
    });
});
//获取点赞
scope.pagedata.vote=function(){
	var params={
		data:{'vote':scope.pagedata.item.isvote},
		op:'jy_weishoplive/room/vote/',
		callback:function(res){		
			if(res.success == 1){
				scope.message(res.msg);
				if(res.istanchu ==1){
					setTimeout(function(){
						scope.pagedata.chaihb=true
						scope.$evalAsync();
					},1000);
				}
				if(!res.isvote){
					scope.pagedata.item.votes++
				}
				scope.$evalAsync();
				var time = 0
				for(var i = 0;i<88;i++){
					setTimeout('likepiaofu()',time);
					if(i<10){
						time += 100
					}else if(i>=10 && i<20){
						time += 200
					}else if(i>=20 && i<30){
						time += 300
					}else if(i>=30 && i<40){
						time += 400
					}else if(i>=40 && i<50){
						time += 500
					}else if(i>=50 && i<60){
						time += 600
					}else if(i>=60 && i<70){
						time += 700
					}else if(i>=70 && i<80){
						time += 800
					}else{
						time += 900
					}
				}
			}
			
		}
	};
	scope.post_json(params);
}
//收藏
scope.pagedata.setshoucang=function(){
	var params={
		data:{'isshoucang':scope.pagedata.isshoucang},
		op:'jy_weishoplive/room/like/',
		callback:function(res){
			scope.message(res)
		}
	};
	scope.post_json(params);
}
//获取关注
scope.pagedata.setfollow=function(){
	var params={
		op:'jy_weishoplive/room/like/',
		callback:function(res){
			scope.message(res)
			var time = 0
			for(var i = 0;i<88;i++){
				setTimeout('followpiaofu()',time);
				if(i<10){
					time += 100
				}else if(i>=10 && i<20){
					time += 200
				}else if(i>=20 && i<30){
					time += 300
				}else if(i>=30 && i<40){
					time += 400
				}else if(i>=40 && i<50){
					time += 500
				}else if(i>=50 && i<60){
					time += 600
				}else if(i>=60 && i<70){
					time += 700
				}else if(i>=70 && i<80){
					time += 800
				}else{
					time += 900
				}
			}
		}
	};
	scope.post_json(params);
}
//获取留言
scope.pagedata.getmsg=function(){
	var params={
		data:{},
		op:'jy_weishoplive/room/getmsg/',
		callback:function(res){
			scope.$evalAsync();
		}
	};
	scope.post_json(params);
}
//获取留言
scope.pagedata.delmsg=function(index){
	var id=scope.pagedata.msgs[index].index
	var params={
		data:{'id':id},
		op:'jy_weishoplive/room/delmsg/',
		callback:function(res){
			scope.message('撤销成功！','error');
		}
	};
	scope.post_json(params);
}
//提交留言
scope.pagedata.setmsg=function(msg){
	if(!msg){
		scope.message('发布失败，没有内容！','error');
	}
	var id=scope.pagedata.item.id
	var params={
		data:{'msg':msg,'id':id},
		op:'jy_weishoplive/room/setmsg/',
		callback:function(res){
			scope.message(res.msg)
			//scope.pagedata.msgs.push(res.data);
			scope.pagedata.post.msg='';
			scope.$evalAsync();
			//vote_tanmu(msg,res.avatar)
		}
	};
	scope.post_json(params);
}
//发券成功
scope.pagedata.sendcoupon=function(){
	var params={
		data:{},
		op:'jy_weishoplive/room/sendcoupon/',
		callback:function(res){
			scope.message('发券成功');
		}
	};
	scope.post_json(params);
}
scope.pagedata.getcoupon=function(id){
		var params={
			data:{id:id},
			op:'jy_weishop/coupon.detail/getcoupon/',
			callback:function(res){
					scope.message('领券成功');
			}
		};
		scope.post_json(params);
}
function likepiaofu() {
		var x = 100;       
		var y = 330;
		var num = Math.floor(Math.random() * 6 + 1);
		var index=$('.likepiaofu').children('img').length;
		var rand = parseInt(Math.random() * (x - y + 1) + y); 
		$(".likepiaofu").append("<img src=''>");
		$(".likepiaofu").find('img:eq(' + index + ')').attr('src','../addons/jy_weishoplive/resource/img/like_icon_'+num+'.png')
		$(".likepiaofu").find("img").animate({
			bottom:"500px",
			opacity:"0",
			right: rand,
			width:"32px"
		},3000)
}
function followpiaofu() {
		var x = 100;       
		var y = 330;
		var num = Math.floor(Math.random() * 6 + 1);
		var index=$('.followpiaofu').children('img').length;
		var rand = parseInt(Math.random() * (x - y + 1) + y); 
		$(".followpiaofu").append("<img src=''>");
		$(".followpiaofu").find('img:eq(' + index + ')').attr('src','../addons/jy_weishoplive/resource/img/follow_icon_'+num+'.png')
		$(".followpiaofu").find("img").animate({
			bottom:"500px",
			opacity:"0",
			right: rand,
			width:"32px"
		},3000)
}
function reset_body(){
	document.body.scrollTop = document.body.scrollTop;
}
//信息弹窗：
//前端先注册以等待接收消息
require(['jinyun_socket'],function(jinyun_socket){
    jinyun_socket.connect(function(){
            jinyun_socket.join('room'+scope.pagedata.item.id);
			console.log('加入ID组：');console.log('room'+scope.pagedata.item.id);
     });	 
    jinyun_socket.onsystem=function(res){
        console.log('收到来自后端的消息：');console.log(res);
		if(res.message.type=='sendred'){
			scope.pagedata.showredpack=true;
			scope.pagedata.redid=res.message.redid
			scope.pagedata.isgetred=false
			scope.pagedata.msgs.push(res.message.data);
		}
		if(res.message.type=='getred'){
			scope.pagedata.msgs.push(res.message.data);
		}
		if(res.message.type=='mygetred'){
			scope.pagedata.msgs.push(res.message.data);
		}
		if(res.message.type=='sendcoupon'){
			scope.pagedata.showgetcoupon=true;
			scope.pagedata.nowcoupon=res.message.coupon
			scope.pagedata.msgs.push(res.message.data);
		}
		if(res.message.type=='liping'){
			scope.pagedata.msgs.push(res.message.data);
		}
		if(res.message.type=='msg'){
			scope.pagedata.msgs.push(res.message.data);
		}
		if(res.message.type=='delmsg'){
			for(var i=0;i<scope.pagedata.msgs.length;i++){
				if(scope.pagedata.msgs[i].id==res.message.id){
					scope.pagedata.msgs.splice($i,1)
				}
			}
		}
		scope.$evalAsync();
		$('#ismsg').animate({scrollTop:'100000px'},300);
    }
});
if(scope.pagedata.msgs.length>0){
	var msgs=scope.pagedata.msgs;
	var k=0
	/*for(var i = 0;i<msgs.length;i++){
		setTimeout(
			function(){
					vote_tanmu(msgs[k].content,msgs[k].avatar);
					k++;
			}
		,1700*i);
	}*/
}
function vote_tanmu(msg,picurl) {
		var x = 100;       
		var y = 330;
		var num = Math.floor(Math.random() * 6 + 1);
		var index=$('.video-sms-list').children('li').length;
		picurl=scope.tomedia(picurl);
		picurl = picurl?picurl:'../core/resource/images/nopic.jpg';
		$htmls = '<li class="video-sms-pane"><div class="video-sms-text"><img class="video-sms-logo" src="'+ picurl+'"/><span class="overflow-h">：'+msg+'</span></div></li>';
		$(".video-sms-list").append($htmls);
		$(".video-sms-list").find("li").animate({
			bottom:"600px",
			opacity:"0",
		},10000)
}
//减少
scope.pagedata.minus=function(){
	if(scope.pagedata.post.num <=1){
		return false;
	}
	scope.pagedata.post.num--;
	scope.$evalAsync();
}
//增加
scope.pagedata.plus=function(){
	if(scope.pagedata.item.usermaxbuy>0 && scope.pagedata.item.order_goodscount + scope.pagedata.post.num>=scope.pagedata.item.usermaxbuy){
		scope.message('不能再加了，超过该商品最大购买量！','error');
		return false;
	}
	if(scope.pagedata.item.maxbuy>0 && scope.pagedata.post.num>=scope.pagedata.item.maxbuy){
		scope.message('不能再加了，超过该商品单次购买量！','error');
		return false;
	}
	if(scope.pagedata.post.num>=scope.pagedata.options.stock || scope.pagedata.post.num>=scope.pagedata.item.total){
		scope.message('不能再加了，超了库存啦！','error');
		return false;
	}
	scope.pagedata.post.num++;
	scope.$evalAsync();
}
//选择
scope.pagedata.get_optionsid=function(){
	var specid = scope.pagedata.post.specid;
		specid = specid.join('_');
	scope.post_json('jy_weishop/goods.detail/get_optionsid/',{'specid':specid,'goodsid':scope.pagedata.goods.id},function(res){
			scope.pagedata.post.optionsid=res.options.id;
			scope.pagedata.options=res.options;
			scope.pagedata.item.price=res.options.price;
			scope.pagedata.item.originalprice=res.options.productprice;
			scope.pagedata.selespename=res.selespename;
			scope.$evalAsync();
	});
}
scope.pagedata.check_buy=function(){
	var goodsid=scope.pagedata.goods.id
	var num=scope.pagedata.post.num
	var optionsid=scope.pagedata.post.optionsid
	var addressid=scope.pagedata.post.addressid
	var storeid=scope.pagedata.post.storeid
	scope.get('jy_weishop/goods.detail/check_buy/goodsid='+goodsid+'&num='+num+'&optionsid='+optionsid+'&addressid='+addressid+'&storeid='+storeid+'&roomid='+scope.pagedata.item.id,function(res){});
}
</script>